home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-03-20 | 3.5 KB | 144 lines | [TEXT/KAHL] |
- /*
- included stuff for Banana Jr.
-
- created 9/2/92 Dave Hersey
-
- - - - - - - - - - - - - - - -
-
- 9/93 updated to run with the ß2 "GXified" interface files - PLA
- 3/94 updated for B4 - dmh
- 3/94 general cleanup/debugging - dmh
- 8/94 universalized - dmh
- */
-
-
- // This is the structure we use to hold our private data for each page of a document.
-
- typedef struct {
- gxFormat pageFormat; // format for this page.
- gxShape pageShape; // shape for this page.
- } T_Page, *TP_Page, **TH_Page;
-
-
- // This is the structure we use to hold our private data for each document. We store a handle to one of these beasties
- // in each window's refCon field.
-
- typedef struct {
- gxJob docJob; // print job for this document.
- short numPages; // number of pages in this document. (one based)
- short curPage; // current page being displayed. (one based)
- WindowPtr window; // Document's WindowPtr.
- gxViewPort viewPort; // Window's viewPort.
- TH_Page docPage[]; // array of pages in this document. (zero based)
- } T_Doc, *TP_Doc, **TH_Doc;
-
-
-
- #define kBananaCollectionType 'bana' // Item type for the 'bana' collection
-
-
- // BananaCollection - structure for our collection. This format must match that
- // of the 'xdtl' in our resource file.
-
- typedef struct
- {
- char one;
- Boolean two;
- Boolean three;
- Boolean four;
- } T_BananaCollection, *TP_BananaCollection, **TH_BananaCollection;
-
- //globals from main.c:
-
- extern short gAppResRefNum;
- extern Rect gWindowQDRect;
- extern Str255 gWindowTitle;
- extern Boolean gDebugging;
- extern Boolean gGiveMeValidation;
- extern long gGraphicsHeapSize;
- extern Boolean gQuitting;
- extern long gSleep;
-
-
- // Prototypes: //
-
- //main.c:
-
- void main(void);
- OSErr MyPrintingEventOverride(EventRecord *anEvent, Boolean filterEvent);
-
- //init.c:
-
- OSErr DoDocInit(WindowPtr);
- void DoDraw(WindowPtr);
- OSErr DoCreateNew(void);
- void DoDispose(WindowPtr);
- void CreateSampleImage(TH_Doc doc, short whichPg);
-
- //menus & windows.c:
-
- void EventLoop(void);
- void MyDoEvent(EventRecord *theEvent);
- void DoMenuCommand(long menuResult);
- OSErr AddPage(TH_Doc doc, short *whichPg);
- void DisposePage(TH_Doc doc, short whichPg);
- TH_Doc GetDoc(WindowPtr wind);
- TH_Page GetDocPage(TH_Doc doc, short whichPg);
- gxShape GetDocShape(TH_Doc doc, short whichPg);
- gxJob GetDocJob(TH_Doc doc);
-
- //printing.c:
-
- void SetUpEditMenuRec(gxEditMenuRecord *menuRec);
- OSErr DoDocFormat(WindowPtr wind, gxDialogResult *result);
- OSErr DoPageFormat(WindowPtr wind, gxDialogResult *result);
- OSErr DoPrinting(WindowPtr wind);
- OSErr MyPrintOneCopy(WindowPtr wind);
- OSErr DoPrintLoop(WindowPtr wind);
- void CheckForIdiots(gxFormat aFormat, gxShape pageShape);
- OSErr MyReplaceCollectionItem(void *newData, long collectSize,
- OSType collectType, long collectID,
- Collection whichCollection,
- Ptr *oldData, long *oldDataSize);
-
- //panels.c:
-
- OSErr PageFormatDialog(gxFormat aFormat, StringPtr title, gxDialogResult *result);
- OSErr SetUpByPagePanel(gxFormat aFormat, short ourResFile);
-
-
- // resource & menu item equates:
-
- #define kFormatPanelResID 128
-
- #define rMenuBar 128
- #define mApple 128
- #define iAbout 1
-
- #define mFile 129
- #define iNew 1
- #define iOpen 2
- #define iClose 3
- #define iSave 4
- #define iDocSetup 6
- #define iPageSetup 7
- #define iPrint 8
- #define iPrintOne 9
- #define iQuit 11
-
- #define mEdit 130
- #define iUndo 1
- #define iCut 3
- #define iCopy 4
- #define iPaste 5
- #define iClear 6
-
- #define mDocument 131
- #define iAddPage 1
- #define iDeletePage 2
- #define iNextPage 4
- #define iPrevPage 5
-
-
-
-